package com.vick.task;

import com.ouken.tool.ConnectServer;

import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.widget.ImageView;

public class GetImageTask extends AsyncTask<String, Void, Bitmap> {
	private ImageView ivTarget;
	@Override
	protected void onPreExecute() {
		super.onPreExecute();
	}

	@Override
	protected Bitmap doInBackground(String... params) {
		return ConnectServer.getBitmap(params[0]);
	}
	
	@Override
	protected void onPostExecute(Bitmap result) {
		super.onPostExecute(result);
		ivTarget.setImageBitmap(result);
	}
	
	public GetImageTask(ImageView ivTarget){
		this.ivTarget=ivTarget;
	}
}
